<?php
/**
 * Created by PhpStorm.
 * User: songs
 * Date: 2019/10/20
 * Time: 17:44
 */
use App\Models\Admin\OrderTempModel;
use App\admin\Service\OA;
use App\Models\Admin\OrderBaleModel;
use App\Models\User\UserModel;
use App\Jobs\Fun;
use App\Models\CompanysModel;
use App\Models\User\UserOrdersModel;
use App\Models\Admin\OrderCheckModel;

$out_trade_no = $_GET['out_trade_no'] ?? '';
if ($out_trade_no == '') {
    Fun::showmsg("参数错误");
}
$orderTempModel = OrderTempModel::where(['out_trade_no' => $out_trade_no])->first();
if (!$orderTempModel) {
    Fun::showmsg("订单不存在");
}
$out_trade_no = $orderTempModel->out_trade_no;
$uid = OA::$user->getId();
$type = null; ///gs表示公司  gc 表示工厂
if ($orderTempModel->cid == $uid) {
    $type = 'gs';    ///表示公司
} elseif ($orderTempModel->fid == $uid) {
    $type = 'gc';    ///表示工厂
} else {
    Fun::showmsg("您无权限操作表单");
}
$OrderCheckModel = OrderCheckModel::where(['out_trade_no' => $out_trade_no])->first();
$check_uid = '';
if ($OrderCheckModel&&$OrderCheckModel->check_uid==OA::$user->getId()) {
    $check_uid = 'true';
}

?>
@extends("h5.layouts.main")
@section('content')
    <link rel="stylesheet" type="text/css" href="/h5/css/my.css">
    <link rel="stylesheet" type="text/css" href="../datepicker/jquery-ui.min.css">
    <link rel="stylesheet" type="text/css" href="../css/app.css">
    <link rel="stylesheet" type="text/css" href="../css/orderGrad.css">

    <input id="out_trade_no" value="<?= $orderTempModel->out_trade_no ?>" type="hidden"/>
    <input id="type" value="<?= $type ?>" type="hidden"/>
    <!-- 我的订单（抢单和订单） -->
    <div class="orderDockingPage">
        <div class="orderParamTitle">
        <span>跟单验货报告 (<?php
            if ($type == 'gs') {
                echo "公司";
            } else {
                echo "工厂";
            }
            ?>)</span>
            <a onclick="MC.back()" class="back"> <img src="../images/return.png" class="orderRtns"/></a>
        </div>
        <div style="height:1.066667rem"></div>
        <input type="hidden" value="<?= $check_uid ?>" id="check_uid"/>

        <div class="comCheckDiv">
            <?php if($OrderCheckModel){ ?>
            <div id="settingPage">

                <div class="tablelist pagetop">
                    <ul>
                        <li class="clearfix li">
                            <span class="lable">加工企业</span>
                            <input type="text" value="" id="orderFacName" placeholder="请输入" class="value"/>
                        </li>
                        <li class="clearfix li">
                            <span class="lable">工厂负责人电话</span>
                            <input type="text" value="" placeholder="请输入" id="leaderMobile" class="value"/>
                        </li>
                    </ul>


                </div>
                <div style="height:15px"></div>
                <div class="settingParam">
                    <!--<p style="padding:0;">订单详情</p>-->
                    <!--stylelist 款式参数，一维数组：-->
                    <table cellspacing="0">
                        <tr>
                            <td class="left">款号</td>
                            <td>
                                <input type="text" id="styleNo" placeholder="请输入">
                            </td>
                        </tr>
                        <tr>
                            <td class="left">面料</td>
                            <td>
                                <input type="text" id="fabric" placeholder="请输入">
                            </td>
                        </tr>
                        <tr>
                            <td class="left">辅料</td>
                            <td>
                                <input type="text" id="assist" placeholder="请输入">
                            </td>
                        </tr>
                        <tr>
                            <td class="left">订单数量</td>
                            <td>
                                <input type="text" id="orderNum" placeholder="请输入">
                            </td>
                        </tr>
                        <tr>
                            <td class="left">裁剪数量</td>
                            <td>
                                <input type="text" id="cutNum" placeholder="请输入">
                            </td>
                        </tr>
                        <tr>
                            <td class="left">生产本款人数</td>
                            <td>
                                <input type="text" id="staffNum" placeholder="请输入">
                            </td>
                        </tr>
                        <tr>
                            <td class="left">裁制当天下货数量</td>
                            <td>
                                <input type="text" id="trimNum" placeholder="请输入">
                            </td>
                        </tr>
                        <tr>
                            <td class="left">后道当天送货数量</td>
                            <td>
                                <input type="text" id="backNum" placeholder="请输入">
                            </td>
                        </tr>
                        <tr>
                            <td class="left">本款送货总数</td>
                            <td>
                                <input type="text" id="styleNum" placeholder="请输入">
                            </td>
                        </tr>
                        <tr>
                            <td class="left">预计全部结束时间</td>
                            <td>
                                <input type="text" id="period" placeholder="请输入">
                            </td>
                        </tr>
                    </table>
                    <!--sizelist 尺码参数，一维数组：【M、L、XL、XXL】-->
                    <table cellspacing="0" id="sizelist">
                        <tr>
                            <td colspan="5" class="bg" style="text-align:center">
                                尺寸对照工艺单，标出大小公差就好
                            </td>
                        </tr>
                        <tr>
                            <td class="bg">部位</td>
                            <td>M</td>
                            <td>L</td>
                            <td>XL</td>
                            <td>XXL</td>
                        </tr>
                        <tr>
                            <td class="bg left2">领围/腰围</td>
                            <td>
                                <input type="text" placeholder="请输入" id="waist_1">
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="waist_2">
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="waist_3">
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="waist_4">
                            </td>
                        </tr>
                        <tr>
                            <td class="bg left2">袖长/臀围</td>
                            <td>
                                <input type="text" placeholder="请输入" id="hip_1">
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="hip_2">
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="hip_3">
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="hip_4">
                            </td>
                        </tr>
                        <tr>
                            <td class="bg left2">后中长/裤长</td>
                            <td>
                                <input type="text" placeholder="请输入" id="trouser_1">
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="trouser_2">
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="trouser_3">
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="trouser_4">
                            </td>
                        </tr>
                        <tr>
                            <td class="bg left2">胸围/拉链</td>
                            <td>
                                <input type="text" placeholder="请输入" id="bust_1">
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="bust_2">
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="bust_3">
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="bust_4">
                            </td>
                        </tr>
                        <tr>
                            <td class="bg left2">下摆/脚口</td>
                            <td>
                                <input type="text" placeholder="请输入" id="hem_1">
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="hem_2">
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="hem_3">
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="hem_4">
                            </td>
                        </tr>
                    </table>
                    <!--thrumlist 线头参数，二维数组：-->
                    <table cellspacing="0" id="thrumlist">
                        <tr>
                            <td colspan="2" class="bg">
                                重点检查
                            </td>
                            <td class="bg">缝制问题</td>
                        </tr>
                        <tr>
                            <td class="bg" rowspan="2">线头情况</td>
                            <td class="left3">
                                <label id="thrumInput1"><input type="radio" name="radio1"
                                                               onclick="setThrum(1)">有 </label>
                                &nbsp; &nbsp;
                                <label id="thrumInput2"><input type="radio" name="radio1"
                                                               onclick="setThrum(2)">少 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="thrum_2">
                            </td>
                        </tr>
                        <tr>
                            <td class="left3">
                                <label id="thrumInput3"><input type="radio" name="radio1"
                                                               onclick="setThrum(3)">从剪 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="thrum_3">
                            </td>
                        </tr>
                        <tr>
                            <td class="bg" rowspan="2">污迹情况</td>
                            <td class="left3">
                                <label id="smearInput1"><input type="radio" name="radio2"
                                                               onclick="setSmear(1)">有 </label>
                                &nbsp; &nbsp;
                                <label id="smearInput2"><input type="radio" name="radio2"
                                                               onclick="setSmear(2)">少 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="smear_2">
                            </td>
                        </tr>
                        <tr>
                            <td class="left3">
                                <label id="smearInput3"><input type="radio" name="radio2"
                                                               onclick="setSmear(3)">无 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="smear_3">
                            </td>
                        </tr>
                        <tr>
                            <td class="bg" rowspan="2">毛脱漏情况</td>
                            <td class="left3">
                                <label id="hairInput1"><input type="radio" name="radio3"
                                                              onclick="setHair(1)">有 </label>
                                &nbsp; &nbsp;
                                <label id="hairInput2"><input type="radio" name="radio3"
                                                              onclick="setHair(2)">少 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="hair_2">
                            </td>
                        </tr>
                        <tr>
                            <td class="left3">
                                <label id="hairInput3"><input type="radio" name="radio3"
                                                              onclick="setHair(3)">无 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="hair_3">
                            </td>
                        </tr>
                        <tr>
                            <td class="bg" rowspan="2">尺寸情况</td>
                            <td class="left3">
                                <label id="sizeInput1"><input type="radio" name="radio4"
                                                              onclick="setSize(1)">超出误差范围 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="size_2">
                            </td>
                        </tr>
                        <tr>
                            <td class="left3">
                                <label id="sizeInput2"><input type="radio" name="radio4"
                                                              onclick="setSize(2)">在误差范围内 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="size_3">
                            </td>
                        </tr>
                        <tr>
                            <td class="bg" rowspan="2">送货单是否清楚</td>
                            <td class="left3">
                                <label id="listInput1"><input type="radio" name="radio5"
                                                              onclick="setList(1)">清楚 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="list_2">
                            </td>
                        </tr>
                        <tr>
                            <td class="left3">
                                <label id="listInput2"><input type="radio" name="radio5"
                                                              onclick="setList(2)">重填 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="list_3">
                            </td>
                        </tr>
                        <tr>
                            <td class="bg" rowspan="2">明切线是否一致</td>
                            <td class="left3">
                                <label id="tangentInput1"><input type="radio" name="radio6"
                                                                 onclick="setTangent(1)">是 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="tangent_2">
                            </td>
                        </tr>
                        <tr>
                            <td class="left3">
                                <label id="tangentInput2"><input type="radio" name="radio6"
                                                                 onclick="setTangent(2)">返修 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="tangent_3">
                            </td>
                        </tr>
                        <tr>
                            <td class="bg" rowspan="2">包装是否整齐</td>
                            <td class="left3">
                                <label id="packInput1"><input type="radio" name="radio7"
                                                              onclick="setPack(1)">是 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="pack_2">
                            </td>
                        </tr>
                        <tr>
                            <td class="left3">
                                <label id="packInput2"><input type="radio" name="radio7"
                                                              onclick="setPack(2)">不是 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="pack_3">
                            </td>
                        </tr>
                        <tr>
                            <td class="bg" rowspan="2">整烫是否平服</td>
                            <td class="left3">
                                <label id="ironingInput1"><input type="radio" name="radio8"
                                                                 onclick="setIroning(1)">是 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="ironing_2">
                            </td>
                        </tr>
                        <tr>
                            <td class="left3">
                                <label id="ironingInput2"><input type="radio" name="radio8"
                                                                 onclick="setIroning(2)">返修 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="ironing_3">
                            </td>
                        </tr>
                        <tr>
                            <td class="bg" rowspan="2">加工单位是否配合</td>
                            <td class="left3">
                                <label id="devoteInput1"><input type="radio" name="radio9"
                                                                onclick="setDevote(1)">有 </label>
                                &nbsp; &nbsp;
                                <label id="devoteInput2"><input type="radio" name="radio9"
                                                                onclick="setDevote(2)">一般 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="devote_2">
                            </td>
                        </tr>
                        <tr>
                            <td class="left3">
                                <label id="devoteInput3"><input type="radio" name="radio9"
                                                                onclick="setDevote(3)">不是 </label>
                            </td>
                            <td>
                                <input type="text" placeholder="请输入" id="devote_3">
                            </td>
                        </tr>
                    </table>
                    <br>
                </div>

                <div class="orderDocumentaryInspectionReport ">
                    <div class="content5">
                        <p>内容</p>
                        <div>
                            <textarea name="" placeholder="请输入您遇到的问题（10-200字）"></textarea>
                        </div>
                    </div>
                    <div class="content6">
                        <ul>
                            <li><span>工厂总人数</span><input type="text" placeholder="请输入"></li>
                            <li><span>本款生产人数</span><input type="text" placeholder="请输入"></li>
                            <li><span>后道全部结束时间</span><input type="text" placeholder="请输入"></li>
                        </ul>
                    </div>
                    <div class="content7">
                        备注：外协单位出货时，必须有跟单员验货报告，经验货合格后，双方签字方可送货。
                    </div>
                </div>


            </div>
                <?php if($check_uid!==''){ ?>
                <div class="saveDiv">
                    <a class="button savebutton">保存</a>
                </div>
        <?php }
            }else{ ?>

                    <h2 class="gdnull">公司未设置跟单验货报告</h2>


        <?php } ?>



        </div>
    </div>





    <script>
        new MC.Order.comCheck();

    </script>
@stop